﻿using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;

namespace zielonka.co.uk.extensions.system
{
    // Description:	Returns a MemoryStream from a Byte array
    /*
        MemoryStream ms = File.ReadAllBytes(@"c:\test.txt").ToMemoryStream();
     */

    public static partial class ByteExtensions
    {
        public static MemoryStream ToMemoryStream(this Byte[] buffer)
        {
            MemoryStream ms = new MemoryStream(buffer);
            ms.Position = 0;
            return ms;
        }
    }
}
